<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 序号除以 3 余数为 1 的元素 */
    ul>:nth-child(3n+1) {
      color: red;
    }
  </style>
</head>

<body>
  <ul>
    <li>Hello world!</li>
    <li>Hello world! 2</li>
    <li>Hello world! 3</li>
    <li>Hello world! 4</li>
    <li>Hello world! 5</li>
    <li>Hello world! 6</li>
    <li>Hello world! 7</li>
  </ul>
</body>

</html>